﻿using System.Drawing;
using System.Windows.Forms.Extensions.Appearance.Interface;
using System.Windows.Forms.Extensions.Appearance.Subcontrols;
using Transitions;

namespace System.Windows.Forms.Extensions.Appearance.Animations
{
    /// <summary>
    /// Fader notifyer animation
    /// </summary>
    public class FadeAnimation : IAnimation
    {
        /// <summary>
        /// Fade in
        /// </summary>
        /// <returns></returns>
        public void In(ITheme theme, INotifierPanel notifierPanel)
        {
            notifierPanel.Top = 0;
            notifierPanel.BackColor = theme.StartingBackgroundColor;
            var fadeIn = new TransitionType_Linear(800);
            Transition.run(notifierPanel, "BackColor", theme.BackgroundColor, fadeIn);

            notifierPanel.Visible = true;
        }

        /// <summary>
        /// Fade out
        /// </summary>
        /// <returns></returns>
        public void Out(ITheme theme, INotifierPanel notifierPanel)
        {
            //var fadeOut = new Transition(new TransitionType_Linear(200));
            //fadeOut.add(notifyerPanel, "BackColor", theme.StartingBackgroundColor);
            //Transition.runChain(fadeOut);

            notifierPanel.Visible = false;
        }

    }
}
